home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
misc
/
gfront11.lha
/
GUIFront
/
Demos
/
Source
/
mystartup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-14
|
762b
|
45 lines
/* Tinystartup.c - some very crude startup code for SAS/C */
#include <proto/exec.h>
#include <proto/dos.h>
#include <workbench/startup.h>
#include <dos/dosextens.h>
struct ExecBase *SysBase;
struct DosLibrary *DOSBase;
extern main(void);
__saveds startup(void)
{
int rv = 0;
SysBase = *((struct ExecBase **)4);
if (DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",36))
{
struct WBStartup *WBenchMsg;
struct Process *pr;
pr = (struct Process *)FindTask(0);
if (!pr->pr_CLI)
{
WaitPort(&pr->pr_MsgPort);
WBenchMsg = (struct WBStartup *)GetMsg(&pr->pr_MsgPort);
}
rv = main();
CloseLibrary((struct Library *)DOSBase);
if (!pr->pr_CLI)
{
Forbid();
ReplyMsg((struct Message *)WBenchMsg);
}
}
return(rv);
}